App.require(function () {
    var app = App.getCurrent();

    app.definePage("strmenulistactive", {
        render: function (next) {
            this.data = {
                cssString: this.parent.data.cssString,
                list: this.parent.data.list,
                pagename: this.parent.data.pagename
            };
            this.fetch("./index.html", function (text) {
                next(this.renderHTML(text));
            });
        },
        getDomObj: function () {
            this.domList.doc = window;
            this.attachDom("#listContent", "container")
                .attachEvent("doc", "click", this.clickDocHandler, true)
                .attachEvent("container", "menuitemclick", this.clickContainerHandler, false);
        },
        clickDocHandler: function (ev) {
            this.parent.hidden();
        },
        clickContainerHandler: function (ev) {
            var originEvent = ev.detail.event;
            originEvent.stopPropagation();
            var page = app.getActivePage(this.data.pagename);
            if (page) {
                this.parent.dispatchEventByName("menulistclick", page, {
                    popup: this.parent,
                    value: ev.detail.value,
                    component: ev.detail.component
                })
            }
        },
    })
})